***************************************************************
HiMIPv6 Project 
Installation Guide for Leaf-1 Foreign Mobility Agent

By Chung-Chun Huang, Cheng-Wei Lee, Fan Liu, and 
Professor Yeali S. Sun
***************************************************************

0. Install RedHat 7.2,including the kernel source on your machines. 
	We recommand that you choose LILO to be boot manager.
	
	Copy the entire data on the HiMIPv6_Install_packages to SOMEWHERE.
	We STRONGLY recommand that SOMEWHERR = /root
	

1. Patch MobileIPv6/HiMIPv6 patch file, and make new kernel

	a. Backup Liuux source(Optional)
		# tar -zcvf /usr/src/linux-2.4.7-10.tgz /usr/src/linux-2.4.7-10

	b. Generate the file: /usr/src/linux-2.4/.config
		# cd /usr/src/linux-2.4.7-10
    	# make menuconfig
    	Make no changes. Save and Exit.

	c. Patch MobileIPv6
		# cd SOMEWHERE
		# tar -zxvf mipv6-0.9-v2.4.7.tar.gz
		# cp SOMEWHERE/mipv6-0.9-v2.4.7/mipv6-0.9-v2.4.7.patch /usr/src/linux-2.4.7-10
		# cd /usr/src/linux-2.4.7-10
		# patch -p1 < mipv6-0.9-v2.4.7.patch

	d. Patch HiMIPv6 
		# cp SOMEWHERE/HiMIPv6_FMA-v2.4.7.patch /usr/src/linux-2.4.7-10
		# cd /usr/src/linux-2.4
		# patch -p1 < HiMIPv6_FMA-v2.4.7.patch
		
	e. Have the kernel modules needed selected
		# cd /usr/src/linux-2.4.7-10
		# make menuconfig
		In 'Networking Options -->', select 'IPv6: Mobility Support (EXPERIMENTAL)'.
		Also select 'MIPv6: FMA Hierarchy(EXPERIMENTAL)'.

	f. Make kernel
		# cd /usr/src/linux-2.4.7-10
		# make clean;make oldconfig;make dep;make bzImage
		# cp arch/i386/boot/bzImage /boot/HiMIPv6-2.4.7
		Add the new kernel image 'HiMIPv6-2.4.7' to boot manager
	
		If you choose LILO to be boot manager, edit '/etc/lilo.conf'.
		The file may be modified and looked like 'SOMEWHERE/lilo.conf'
		After modifying lilo.conf,
		# lilo
		
	g.
		# make modules
		# reboot
		Use HiMIPv6-2.4.7 kernel image to boot.
		# cd /usr/src/linux-2.4.7-10
		# make modules_install	

	h. Install mipdiag tool
		# cd SOMEWHERE/mipv6-0.9-v2.4.7/userspace/
		# ./configure
		# make;make install
		# mknod /dev/mipv6_dev c 0xf9 0
	
	i. Patch mipdiag tool
		# cp SOMEWHERE/mipdiag.c SOMEWHERE/mipv6-0.9-v2.4.7/userspace/
		replace the original file
		# make;make install


2BInstall PCMCIA and Wireless PC Card driver
	a. Extract the driver of PCMCIA (pcmcia-cs-3.2.0.tar.gz)
		# cd SOMEWHERE
		# tar -zxvf pcmcia-cs-3.2.0.tar.gz

	b. Extract the driver of Wireless PC Card (WLLI610.TGZ) to the directory of PCMCIA driver
		# cd SOMEWHERE/pcmcia-cs-3.2.0
		# tar -zxvf ../WLLI610.TGZ
		The wireless card driver(WLLI610.TGZ) is for the AVAYA 802.11b Wireless Card. We STRONGLLY recommand that you use AVAYA 802.11b Wireless Card. OR you have to use your own wireless card driver.
		
	c. Install
		# cd SOMEWHERE/pcmcia-cs-3.2.0
		# make config
		Set Linux Kernel source directory to /usr/src/linux-2.4.7-10.
		Choose 'Y' for all questions, and press Enter(use default) when choosing Module install directory.
		
		# make all;make install
    	# ./Build
		# ./Install
		Modify /etc/pcmcia/wavelan2_cs.conf. Append the following words:
		
		 card "Avaya Wireless PC Card"
	  	  version "Avaya Communication", "Avaya Wireless PC Card"
	  	  bind "wvlan_cs"
	  		
	d. Restart pcmcia
		# /etc/init.d/pcmcia restart


3BInstall Wireless tools (for command 'iwconfig')

	a. Extract wireless_tools.25.tar.gz
		# cd SOMEWHERE
		# tar -zxvf wireless_tools.25.tar.gz
		
	b.Install
		# cd SOMEWHERE/wireless_tools.25
		# make;make install


4BInstall the usagi package(include ping6,telnet for IPv6v6, ftp for IPv6, radvd...)

	a. Extract usagi-linux24-s20020930.tar.bz2
		# cd SOMEWHERE
		# bzip2 -cd usagi-linux24-s20020930.tar.bz2 | tar xvf -
		
	b. Install
		# cd SOMEWHERE/usagi
		# make prepare TARGET=linux24
		# cd SOMEWHERE/usagi/usagi
		# ./configure
		# make;make install
		
	c. Copy the inetd deamon configuration file to /etc
		# cp SOMEWHERE/usagi/usagi/inetd/etc/inetd.conf.sample /etc/inetd.conf
		
	d. Patch radvd tool
		# cp SOMEWHERE/send.c SOMEWHERE/usagi/usagi/radvd/
		overwrite it.
		
		# cp SOMEWHERE/icmp6.h SOMEWHERE/usagi/usagi/libinet6/include_glibc/netinet/
		overwrite it.
		
		# cd SOMEWHERE/usagi/usagi/radvd
		# make;make install


5BInstall SNMP Manage System(Optional)

	a. Extract and install net-snmp-5.0.3.tar.gz
		# cd SOMEWHERE
		# tar -zxvf  net-snmp-5.0.3.tar.gz
		# cp SOMEWHERE/mibHiMIPv6.c  SOMEWHERE/net_snmp_5.0.3/agent/mibgroup
		# cp SOMEWHERE/mibHiMIPv6.h  SOMEWHERE/net_snmp_5.0.3/agent/mibgroup
		# cd SOMEWHERE/net_snmp_5.0.3
		#./configure -with-mib-modules="mibHiMIPv6"
		Answer every question by pressing Enter
		
		# make ; umask 022 ;make install
		
		Add a file named 'snmpd.conf' in '/usr/local/share/snmp/',
		containing the following words:

		 rocommunity public
		 rwcommunity private	

6.Final configurations
	# cp SOMEWHERE/hosts /etc/hosts
	# cp SOMEWHERE/LFMA1/radvd.conf /etc/
	overwrite it
	
	# cp SOMEWHERE/LFMA1/radvd.conf /usr/local/v6/etc/radvd.conf
	# chmod 755 SOMEWHERE/LFMA1/LFMA1.sh

	After Leaf-1 Foreign Mobility Agent booted, use
	# SOMEWHERE/LFMA1/LFMA1.sh
	to get HiMIPv6 test bed ready	